import csv
import numpy as np

math_scores = []

filenames = ['class1.csv', 'class2.csv', 'class3.csv']
for filename in filenames:
        with open(filename, 'r') as file:
            reader = csv.reader(file)
            next(reader)
            for row in reader:
                math_score = int(row[2])
                math_scores.append(math_score)
                math_scores_array = np.array(math_scores)

mean = np.mean(math_scores_array)
median = np.median(math_scores_array)
values, counts = np.unique(math_scores_array, return_counts=True)
mode = values[np.argmax(counts)]
std_dev = np.std(math_scores_array)
variance = np.var(math_scores_array)

print(f"平均值: {mean:.2f}")
print(f"中位数: {median:.2f}")
print(f"众数: {mode}")
print(f"标准差: {std_dev:.2f}")
print(f"方差: {variance:.2f}")